Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Bug] @{target|token_id} not working

1734070735

Edited 1734070826
Richard @ Damery
Pro
API Scripter
My RPGMaster APIs rely heavily on targeting tokens for actions to occur on them. This includes specifying the currently selected token undertaking the action using @{selected|token_id} and specifying the target token of the action using @{target|token_id}.&nbsp; For example, here is a typical command to search a container such as a chest token for what it contains, using the MagicMaster API: !magic --search @{selected|token_id}|@{target|Search Where?|token_id}|@{selected|token_id} Unfortunately, for the last week, @{target|token_id} has not been working in my JumpGate campaigns, which can be seen by selecting a token, typing in chat: @{selected|token_id} = @{target|token_id} and then selecting the same token when asked for the target - two different token_ids are returned, when they should be the same.&nbsp; Not only that, the token_id returned by @{target|token_id} is the same whatever token is selected as the target, and does not have any attributes - e.g. @{target|name} returns an error. This is not an API issue - this happens in a campaign without any APIs loaded. The link below is to a campaign without any APIs installed. Highly repeatable means of causing the token_id problem: Using&nbsp; <a href="https://app.roll20.net/join/18824545/ZhKv_A" rel="nofollow">https://app.roll20.net/join/18824545/ZhKv_A</a> . Go in as a GM (let me know if you need me to grant you this) Go to the top left of the map (rooms 51 &amp; 52 on the map the campaign is currently on - Sahuagin Lair &gt; Level Three). For each token on the Token layer, copy &amp; paste and then delete the original leaving the copy. Do this for all the tokens in these rooms Select any of these tokens and in chat type&nbsp; @{selected|token_id} =&nbsp;@{target|token_id}&nbsp; and select the same token as the target.&nbsp;The two returned IDs should be the same. Repeat with other tokens you replaced to check Exit the campaign Copy the campaign using the Settings &gt; Copy Game function on the Campaign page. Enter either the original or the copy game (it does not matter which - look at both) Go to the top left of the map again, where you copy/pasted the tokens Select any of these tokens that you copy/pasted and again type in chat&nbsp;&nbsp; @{selected|token_id}&nbsp;=&nbsp;@{target|token_id} &nbsp;and select the same token as the target.&nbsp;For me, these then always return wrong IDs for the&nbsp; @{target|token_id} value. Unfortunately, many of my RPGMaster API commands rely on getting the token_id of the token undertaking an action (typically using @{selected|token_id}), and the targeted token_id of the object of that action (using @{target|Message|token_id}) - e.g. a targeted attack or a spell.&nbsp; This bug is preventing play with my APIs, and my group from using Roll20. Further information: This does not seem to be a problem on the map layer - the tokens on the map layer seem to return the correct token_id for both&nbsp;@{selected|token_id} and&nbsp; @{target|token_id}. Moving a token to the GM layer also seems to correct the issue, but I've not left such a token for any time - so it might revert to the issue at some point. Am I doing something wrong? Is it just my JumpGate campaigns that have beome corrupt in some way?
1734096398
timmaugh
Pro
API Scripter
The devs are aware of this one (at least as of November 19). At that point, it was understood as a Jumpgate + Beacon bug. Also around that time there was the bug that character and selected token IDs were being reported as the same thing... which I *think* they corrected. I'm not sure if they think they've corrected everything around IDs (including the problem you're having), so I would definitely suggest opening a ticket and/or posting in the official Roll20 discord's channel for DND 2024 issues:&nbsp;<a href="https://discord.com/channels/1219360755892228146/1288930498030342205" rel="nofollow">https://discord.com/channels/1219360755892228146/1288930498030342205</a>
timmaugh said: The devs are aware of this one (at least as of November 19). At that point, it was understood as a Jumpgate + Beacon bug. Also around that time there was the bug that character and selected token IDs were being reported as the same thing... which I *think* they corrected. I'm not sure if they think they've corrected everything around IDs (including the problem you're having), so I would definitely suggest opening a ticket and/or posting in the official Roll20 discord's channel for DND 2024 issues:&nbsp; <a href="https://discord.com/channels/1219360755892228146/1288930498030342205" rel="nofollow">https://discord.com/channels/1219360755892228146/1288930498030342205</a> Thanks for this. Ticket posted, though this campaign is using the Advanced AD&amp;D 2e sheet - not sure if that makes a difference. I'm completely recreating the campaign (or at least those bits of it I need for the next few sessions of play) using Transmogrifier from an old pre-Jumpgate version of the same campaign, and only Transmogrifying the Player Character sheets from the current Jumpgate campaign so they are in the current state of play.&nbsp; Yet to see if this remains stable...
It's just started happening to me.&nbsp; I'm in a game without any character sheets.&nbsp; It's completely broken my game as I've written entire solutions with the API to streamline every action and interaction and now none of it works.&nbsp; &nbsp;I did find in our last session that if the player tells me what they are going to interact with I can delete that token off the board and re-add it and it will work but stops working almost immediately after I add a different token.
David B. said: It's just started happening to me.&nbsp; I'm in a game without any character sheets.&nbsp; It's completely broken my game as I've written entire solutions with the API to streamline every action and interaction and now none of it works.&nbsp; &nbsp;I did find in our last session that if the player tells me what they are going to interact with I can delete that token off the board and re-add it and it will work but stops working almost immediately after I add a different token. I've been chatting with The Aaron about this, and he says it is a known bug they are working on.&nbsp; In the mean time... I have been able to create a new campaign (in Jumpgate) NOT copied from any other campaign to avoid any corruptions, and then Transmogrified just those parts I need for now of the live campaign I'm currently running (to keep the campaign as simple as possible - and much less work!) and all seems to be fine. @{target|token_id} seems to be working fine, the RPGMaster APIs (and ChatSetAttr, TokenMod &amp; LibTokenMarkers) all seem to be running OK. However: &nbsp;as yet this is just me as the GM running this campaign. On Friday, my group will be playing my campaign with me GMing, so we'll see if lots of activity triggers the issue...
1734712233

Edited 1734712306
Richard @ Damery
Pro
API Scripter
Update 20/12/2024 Played the new campaign I created as described above , but in real multi-user gameplay, the @{target|token_id} error reappeared after about 30 minutes (or less) of play.&nbsp; So this is a really horrendous bug that is stopping my group from playing with the macros and APIs I have loaded.&nbsp; We're going to leave play until 10 January 2025, and hope that a fix has been enacted by then. I wish the devs good luck, and I hope this does not disrupt everyone's festive season too much.&nbsp; I'm sure everyone is working hard to fix this one.